<script setup>
import {createCommentVNode, ref} from 'vue';
  //var msg="你好";
  //绑定数据
  const msg=ref("你坏");
  const htmlA=ref("<span style='color: red'>labubu</span>");
  const bindA=ref("height:100px;width:100px;background-color:green;");

const num=ref(1);


const islogin=ref(false);
const loginname=ref("未登录");
  function clickA(){
    console.log("执行了A方法");
    //改变绑定的数据
    msg.value="大冰";
    htmlA.value="<span style='color: aqua'>拉卜卜</span>";
    bindA.value="height:200px;width:200px;background-color:blue;";
    islogin.value=!islogin.value;
  }
</script>

<template>
  <span>消息是：{{msg}}</span>
  <div v-html="htmlA"></div>
  <button @click="clickA()">点击按钮</button>
  <div :style="bindA"></div>
  <button @click="num++">{{num}}</button>
  <span v-if="islogin">张阿森纳</span>
  <span v-else>已登录</span>
</template>